Make Netlify deploy previews resilient on forks #6728
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently every PR opened from a fork results in a Netlify notification asking to approve the deploy preview; because many of our open source PRs are documentation related, it is convenient to see these builds often. Right now, we have sensitive environment variables for interacting with our MkDocs insiders repo so we don't want to use those for "untrusted" builds.
This PR attempts to change our Netlify build command so that it first attempts to install our Insiders package, but if that fails it falls back to a standard MkDocs build (which should work). We can then turn builds on for unknown authors that don't set sensitive environment variables. This should hopefully let us see useful deploy previews at the cost of not knowing if our insider builds are failing (this should be readily apparent though).
Example
Let's see how the deploy previews go in practice!
Checklist
<link to issue>
"fix
,feature
,enhancement
,docs
, ormaintenance
label categorizing the change.